<?php

class Application_Form_AddCategory extends Zend_Form {

    public function init(){
            // Set the method for the display form to POST
        $this->setMethod('post');
 
        // Name element
        $this->addElement('text', 'name', array(
            'label'      => 'Nume:',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
            	array('StringLength', false, array(0, 50)),
            )
        ));
        
        // Description element
        $this->addElement('textarea', 'description', array(
            'label' => 'Descriere:',
        	'filters'    => array('StringTrim'),
            'required' => true,
        ));
  
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore'   => true,
            'label'    => 'Adauga Categorie',
        ));
    }
}

